package com.bestcem.xm.member.constant;

import com.bestcem.xm.member.controller.vo.EmployeeStatusVO;
import com.bestcem.xm.member.service.dto.MetaFieldDTO;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.util.*;

/**
 * 公共常量类
 *
 * @author zhenz
 * @date 2020/6/1 18:51
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Constants {

    /**
     * 标签默认名称 key
     */
    public final static String LABEL_DEFAULT_NAME_KEY = "member:tag_default_name_";

    /**
     * 标签组默认名称序号 key
     */
    public final static String LABEL_GROUP_DEFAULT_NAME_KEY = "member:tag_group_default_name_";

    /**
     * 扩展字段默认名称序号 key
     */
    public final static String FIELD_DEFAULT_NAME_KEY = "member:field_default_name_";


    public final static Map<Integer, String> SEQUENCE_NAME_MAP = new HashMap<Integer, String>() {{
        put(1, LABEL_DEFAULT_NAME_KEY);
        put(2, LABEL_GROUP_DEFAULT_NAME_KEY);
        put(3, FIELD_DEFAULT_NAME_KEY);
    }};


    /**
     * 默认标签组最大容量
     */
    public static final Integer MAX_LABEL_GROUP_SIZE = 20;

    /**
     * 默认标签最大容量
     */
    public static final Integer MAX_LABEL_SIZE = 200;

    /**
     * 默认标签值最大容量
     */
    public static final Integer MAX_LABEL_VALUE_SIZE = 30;

    /**
     * 默认标签组名称最大长度
     */
    public static final Integer MAX_LABEL_GROUP_NAME_LENGTH = 30;

    /**
     * 默认标签名称最大长度
     */
    public static final Integer MAX_LABEL_NAME_LENGTH = 30;

    /**
     * 默认标签值名称最大长度
     */
    public static final Integer MAX_LABEL_VALUE_NAME_LENGTH = 30;

    /**
     * 免费版联系人数量
     */
    public final static long FREE_USER_MEMBER_NUMBER = 100;

    /**
     * 联系人开放平台最大创建、更新条数
     */
    public static final Integer OPEN_PLATFORM_MAX_OPERATION_MEMBER_NUMBER = 20000;

    /**
     * 最大单页查询联系人数量
     */
    public static final Integer MAX_MEMBER_AMOUNT_SINGLE_PAGE = 1000;

    /**
     * 联系人过滤组织层级，“in”查询最大叶子门店数量
     * 超过该值则关联查询
     */
    public static final Integer STORE_IN_SEARCH_MAX_COUNT = 300;

    /**
     * 联系人微信导入标识
     */
    public static final String WECHAT_IMPORT =  "wechat";

    /**
     * 数字1
     */
    public static final Integer ONE = 1;

    /**
     * 数字-1
     */
    public static final Integer NEGATIVE = -1;

    /**
     * 数字999
     */
    public static final Integer MAX_MILLISECOND = 999;

    /**
     * 地址缓存key
     */
    public static final String CITY_LEVEL_KEY = "member:city_level";

    /**
     * 地址文件路径
     */
    public static final String CITY_FIELD_PATH = "survey/city.json";

    /**
     * 成功
     */
    public static final String SUCCESS = "success";

    /**
     * 无状态
     */
    private final static String MEMBER_EMPLOYEE_STATUS_IGNORE = "无状态,表示不是非内部联系人";

    /**
     * 在职
     */
    private final static String MEMBER_EMPLOYEE_STATUS_WORK = "在职";

    /**
     * 离职
     */
    private final static String MEMBER_EMPLOYEE_STATUS_LEAVE = "离职";

    /**
     * 分页参数 最大页数
     */
    public static final Integer MAX_PAGE_SIZE = 1000;
    /**
     * 分页参数 最大页数
     */
    public static final Integer MIN_PAGE_SIZE = 1;

    /**
     * 表头 -字符串
     */
    public static final String EXCEL_TYPE_STR = "string";

    /**
     * 表头 -数字
     */
    public static final String EXCEL_TYPE_NUMBER = "number";

    /**
     * 默认标签组名称
     */
    public static final String DEFAULT_LABEL_GROUP_NAME = "未分组";

    /**
     * 默认标签单次查询最大数量
     */
    public static final Integer DEFAULT_LABEL_MAX_SINGLE_PAGE = 1000;

    public static final Integer DEFAULT_PAGE = 1;

    public static final Integer DEFAULT_LARGE_PAGE_SIZE = 1000;

    /**
     * 表头 -日期
     */
    public static final String EXCEL_TYPE_DATE = "date";

    public final static Map<Integer, String> EMPLOYEE_STATUS_MAP = new HashMap<Integer, String>() {{
        put(1, MEMBER_EMPLOYEE_STATUS_IGNORE);
        put(2, MEMBER_EMPLOYEE_STATUS_WORK);
        put(3, MEMBER_EMPLOYEE_STATUS_LEAVE);
    }};

    public final static List<MetaFieldDTO> COMPUTES_INFO = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("答题率", "answer_rate", "number", "computes", new ArrayList()));
        add(new MetaFieldDTO("答题完成率", "submit_rate", "number", "computes", new ArrayList()));
        add(new MetaFieldDTO("收到问卷数", "receive_total_count", "number", "computes", new ArrayList()));
        add(new MetaFieldDTO("开始答题问卷数", "start_answer_count", "number", "computes", new ArrayList()));
    }};

    /**
     * 个人联系人基本字段
     */
    public final static List<MetaFieldDTO> INDIV_INFO = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("外部编号", "out_no", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("姓名", "name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("性别", "gender", "select", "info", Arrays.asList("男", "女")));
        add(new MetaFieldDTO("省份", "address.0", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("城市", "address.1", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("区县", "address.2", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("街道信息", "address.3", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("出生日期", "birthday", "datetime", "info", new ArrayList()));
        add(new MetaFieldDTO("年龄", "age", "number", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "store", "level", "info", new ArrayList()));
        add(new MetaFieldDTO("微信OpenID", "openid", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("微信AppID", "appid", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("支付宝ID", "alipay_user_id", "string", "info", new ArrayList()));
    }};

    /**
     * 机构联系人基本信息
     */
    public final static List<MetaFieldDTO> INSTITUT_INFO = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("外部编号", "out_no", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("机构对接人", "name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("机构名称", "institut_name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属部门", "department", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("职位", "position", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("省份", "address.0", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("城市", "address.1", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("区县", "address.2", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("街道信息", "address.3", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "store", "level", "info", new ArrayList()));
    }};


    /**
     * 内部联系人基本信息
     */
    public static final EmployeeStatusVO EMPLOYEE_STATUS_1 = new EmployeeStatusVO(1, "在职");
    public static final EmployeeStatusVO EMPLOYEE_STATUS_2 = new EmployeeStatusVO(2, "离职");
    public final static List<MetaFieldDTO> INNER_INFO = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("姓名", "name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("性别", "gender", "select", "info", Arrays.asList("男", "女")));
        add(new MetaFieldDTO("省份", "address.0", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("城市", "address.1", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("区县", "address.2", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("街道信息", "address.3", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("出生日期", "birthday", "datetime", "info", new ArrayList()));
        add(new MetaFieldDTO("年龄", "age", "number", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "store", "level", "info", new ArrayList()));
        add(new MetaFieldDTO("员工编号", "employeeID", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("员工状态", "employee_status", "select", "info", Arrays.asList(EMPLOYEE_STATUS_1, EMPLOYEE_STATUS_2)));
    }};

    /**
     * 项目基本信息
     */
    public final static List<MetaFieldDTO> PROJECT_BASE_INFO = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("机构对接人", "member.name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("机构名称", "member.institut_name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属部门", "member.department", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("职位", "member.position", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("省份", "member.address.0", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("城市", "member.address.1", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("区县", "member.address.2", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("街道信息", "member.address.3", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "member.mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "member.email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "member.store", "level", "info", new ArrayList()));
    }};

    /**
     * 项目信息
     */
    public final static List<MetaFieldDTO> PROJECT_INFO = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("项目编号", "m_project_code", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("项目名称", "m_project_name", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("立项类型", "m_p_type", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("合同编号", "contractNo", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("合同金额", "contract_money", "number", "project", new ArrayList()));
        add(new MetaFieldDTO("立项时间", "project_time", "datetime", "project", new ArrayList()));
        add(new MetaFieldDTO("客户经理", "account_manager", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("甲方项目经理", "project_manager", "datetime", "project", new ArrayList()));
        add(new MetaFieldDTO("项目经理手机", "project_manager_mobile", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("项目状态", "m_p_status", "string", "project", new ArrayList()));
        add(new MetaFieldDTO("计划开始时间", "program_start", "datetime", "project", new ArrayList()));
        add(new MetaFieldDTO("实际开始时间", "actual_start", "datetime", "project", new ArrayList()));
        add(new MetaFieldDTO("验收时间", "acceptance_time", "datetime", "project", new ArrayList()));
    }};

    /**
     * 个人联系人excel基础表头
     */
    public final static List<String> INDIVIDUAL_BASE_EXCEL_HEADERS = new ArrayList<String>(14) {{
        add("姓名");
        add("微信昵称");
        add("性别");
        add("出生日期");
        add("手机号");
        add("邮箱");
        add("省份");
        add("城市");
        add("区县");
        add("街道信息");
        add("所属组织");
        add("微信AppID");
        add("微信OpenID");
        add("支付宝ID");
    }};

    /**
     * 个人联系人导出excel基础表头
     */
    public final static List<String> INDIVIDUAL_EXPORT_BASE_EXCEL_HEADERS = new ArrayList<String>(14) {{
        add("姓名");
        add("性别");
        add("出生日期");
        add("年龄");
        add("手机号");
        add("邮箱");
        add("省份");
        add("城市");
        add("区县");
        add("街道信息");
        add("所属组织");
        add("微信AppID");
        add("微信OpenID");
        add("支付宝ID");
    }};

    /**
     * 机构联系人excel基础表头
     */
    public final static List<String> INSTITUTION_BASE_EXCEL_HEADERS = new ArrayList<String>(11) {{
        add("机构名称");
        add("机构对接人");
        add("所属部门");
        add("职位");
        add("手机号");
        add("邮箱");
        add("省份");
        add("城市");
        add("区县");
        add("街道信息");
        add("所属组织");
    }};

    /**
     * 内部联系人excel基础表头
     */
    public final static List<String> INTERIOR_BASE_EXCEL_HEADERS = new ArrayList<String>(13) {{
        add("姓名");
        add("性别");
        add("出生日期");
        add("手机号");
        add("邮箱");
        add("省份");
        add("城市");
        add("区县");
        add("街道信息");
        add("所属组织");
        add("员工编号");
        add("员工状态");
    }};

    /**
     * 内部联系人导出excel基础表头
     */
    public final static List<String> INTERIOR_EXPORT_BASE_EXCEL_HEADERS = new ArrayList<String>(13) {{
        add("姓名");
        add("性别");
        add("出生日期");
        add("年龄");
        add("手机号");
        add("邮箱");
        add("省份");
        add("城市");
        add("区县");
        add("街道信息");
        add("所属组织");
        add("员工编号");
        add("员工状态");
    }};

    /**
     * 内部联系人excel基础表头
     */
    public final static List<String> M_PROJECT_BASE_EXCEL_HEADERS = new ArrayList<String>(14) {{
        add("机构名称");
        add("项目编号");
        add("项目名称");
        add("甲方项目经理");
        add("项目经理手机");
        add("项目状态");
        add("立项类型");
        add("立项时间");
        add("客户经理");
        add("合同编号");
        add("合同金额");
        add("计划开始时间");
        add("验收时间");
        add("实际开始时间");
    }};

    /**
     * 主键key
     */
    public final static Map<String, String> PRIMARY_KEY_MAP = new HashMap<String, String>() {{
        put("mobile", "手机号");
        put("email", "邮箱");
        put("out_no", "外部编号");
        put("employeeID", "员工编号");
        put("appid", "微信AppID");
        put("openid", "微信OpenID");
    }};

    public final static Map<Integer, String> PROGRESS_BAR_OPERATION_MAP = new HashMap<Integer, String>() {{
        put(0, "member:member.import");
        put(1, "member:member.export");
    }};


    /**
     * 个人联系人 name与field映射
     */
    public final static Map<String, String> INDIV_FIELD_NAME_AND_FIELD_MAP = new HashMap<String, String>() {{
        put("姓名", ExcelFieldConstants.IND_NAME);
        put("微信昵称", ExcelFieldConstants.IND_NICKNAME);
        put("手机号", ExcelFieldConstants.IND_MOBILE);
        put("邮箱", ExcelFieldConstants.IND_EMAIL);
        put("微信AppID", ExcelFieldConstants.IND_APP_ID);
        put("微信OpenID", ExcelFieldConstants.IND_OPEN_ID);
        put("支付宝ID", ExcelFieldConstants.IND_ALI_PAY_USER_ID);
        put("性别", ExcelFieldConstants.IND_GENDER);
//        put("年龄", "age");
        put("出生日期", ExcelFieldConstants.IND_BIRTHDAY);
        put("所属组织", ExcelFieldConstants.IND_STORE);
        put("省份", ExcelFieldConstants.PROVINCE);
        put("城市", ExcelFieldConstants.CITY);
        put("区县", ExcelFieldConstants.DISTRICT);
        put("街道信息", ExcelFieldConstants.STREET);
        put("外部编号", ExcelFieldConstants.IND_OUT_NO);
    }};

    /**
     * 机构联系人 name与field映射
     */
    public final static Map<String, String> INSTI_FIELD_NAME_AND_FIELD_MAP = new HashMap<String, String>() {{
        put("机构名称", ExcelFieldConstants.INS_INSTITUTE_NAME);
        put("机构对接人", ExcelFieldConstants.INS_NAME);
        put("所属部门", ExcelFieldConstants.INS_DEPARTMENT);
        put("职位", ExcelFieldConstants.INS_POSITION);
        put("手机号", ExcelFieldConstants.INS_MOBILE);
        put("邮箱", ExcelFieldConstants.INS_EMAIL);
        put("所属组织", ExcelFieldConstants.INS_STORE);
        put("省份", ExcelFieldConstants.PROVINCE);
        put("城市", ExcelFieldConstants.CITY);
        put("区县", ExcelFieldConstants.DISTRICT);
        put("街道信息", ExcelFieldConstants.STREET);
        put("外部编号", ExcelFieldConstants.INS_OUT_NO);
    }};

    /**
     * 内部联系人 name与field映射
     */
    public final static Map<String, String> INTER_FIELD_NAME_AND_FIELD_MAP = new HashMap<String, String>() {{
        put("姓名", ExcelFieldConstants.INT_NAME);
        put("手机号", ExcelFieldConstants.INT_MOBILE);
        put("邮箱", ExcelFieldConstants.INT_EMAIL);
        put("性别", ExcelFieldConstants.INT_GENDER);
//        put("年龄", "age");
        put("出生日期", ExcelFieldConstants.INT_BIRTHDAY);
        put("所属组织", ExcelFieldConstants.INT_STORE);
        put("员工编号", ExcelFieldConstants.INT_EMPLOYEE_ID);
        put("员工状态", ExcelFieldConstants.INT_EMPLOYEE_STATUS);
        put("省份", ExcelFieldConstants.PROVINCE);
        put("城市", ExcelFieldConstants.CITY);
        put("区县", ExcelFieldConstants.DISTRICT);
        put("街道信息", ExcelFieldConstants.STREET);
    }};

    /**
     * 项目 name与field映射
     */
    public final static Map<String, String> PROJECT_FIELD_NAME_AND_FIELD_MAP = new HashMap<String, String>() {{
        put("机构名称", ExcelFieldConstants.PROJECT_INSTITUTE_NAME);
        put("项目编号", ExcelFieldConstants.PROJECT_PROJECT_CODE);
        put("项目名称", ExcelFieldConstants.PROJECT_PROJECT_NAME);
        put("立项类型", ExcelFieldConstants.PROJECT_PROJECT_TYPE);
        put("合同编号", ExcelFieldConstants.PROJECT_CONTRACT_NO);
        put("合同金额", ExcelFieldConstants.PROJECT_CONTRACT_MONEY);
        put("立项时间", ExcelFieldConstants.PROJECT_PROJECT_TIME);
        put("客户经理", ExcelFieldConstants.PROJECT_ACCOUNT_MANAGER);
        put("甲方项目经理", ExcelFieldConstants.PROJECT_PROJECT_MANAGER);
        put("计划开始时间", ExcelFieldConstants.PROJECT_PROGRAM_START);
        put("实际开始时间", ExcelFieldConstants.PROJECT_ACTUAL_START);
        put("验收时间", ExcelFieldConstants.PROJECT_ACCEPTANCE_TIME);
        put("项目状态", ExcelFieldConstants.PROJECT_PROJECT_STATUS);
        put("项目经理手机", ExcelFieldConstants.PROJECT_PROJECT_MANAGER_MOBILE);
    }};

    /**
     * 联系人 地址字段
     */
    public final static List<String> ADDRESS_FIELDS = new ArrayList<String>() {{
        add("省份");
        add("城市");
        add("区县");
        add("街道信息");
    }};

    /**
     * 联系人 性别
     */
    public final static List<String> MEMBER_GENDER = new ArrayList<String>() {{
        add("男");
        add("女");
    }};

    /**
     * 扩展字段联系人类型 个人联系人
     */
    public final static Integer M_FIELD_ATTRIBUTE_INDIVIDUAL = 0;

    /**
     * 扩展字段联系人类型 机构联系人
     */
    public final static Integer M_FIELD_ATTRIBUTE_INSTITUTION = 1;

    /**
     * 扩展字段联系人类型 内部联系人
     */
    public final static Integer M_FIELD_ATTRIBUTE_INTERIOR = 2;

    /**
     * 扩展字段联系人类型 项目信息
     */
    public final static Integer M_FIELD_ATTRIBUTE_PROJECT = 3;
    /**
     * 扩展字段联系人状态
     */
    public final static Map<Integer, String> M_FIELD_ATTRIBUTE_MAP = new HashMap<Integer, String>() {{
        put(M_FIELD_ATTRIBUTE_INDIVIDUAL, "个人联系人");
        put(M_FIELD_ATTRIBUTE_INSTITUTION, "机构联系人");
        put(M_FIELD_ATTRIBUTE_INTERIOR, "内部联系人");
        put(M_FIELD_ATTRIBUTE_PROJECT, "项目信息");
    }};

    /**
     * 扩展字段最大限制数量
     */
    public static final Integer MAX_EXTEND_FIELD_AMOUNT = 20;

    /**
     *
     */

    public final static List<String> FIELD_VALUE_TYPE = new ArrayList<String>(6) {{
        add("string");
        add("number");
        add("datetime");
        add("select");
        add("level");
        add("address");
    }};

    public final static List<Integer> EXCEL_FIELD_VALUE_TYPE = new ArrayList<Integer>(3) {{
        add(0);
        add(4);
        add(5);
    }};

    public final static Map<String, String> PUSH_TYPE_MAP = new HashMap<String, String>() {{
        put("wechat", "wechat");
        put("alipay", "alipay_user_id");
        put("mobile", "phone");
        put("email", "email");
        put("interface", "interface");
    }};


    /**
     * 个人联系人默认查询字段
     */
    public final static List<String> INDIVIDUAL_DEFAULT_QUERY_FIELD = new ArrayList<String>(14) {{
        add("姓名");
        add("联系人编号");
//        add("出生日期");
        add("手机号");
        add("邮箱");
        add("性别");
        add("年龄");
        add("所属组织");
        add("地区");
        add("微信OpenID");
        add("支付宝ID");
//        add("微信AppID");
        add("创建时间");
    }};

    /**
     * 机构联系人默认查询字段
     */
    public final static List<String> INSTITUTION_DEFAULT_QUERY_FIELD = new ArrayList<String>(11) {{
        add("机构名称");
        add("联系人编号");
        add("机构对接人");
        add("所属部门");
        add("所属组织");
        add("所属城市");
        add("手机号");
        add("邮箱");
        add("所属门店");
        add("创建时间");
    }};

    /**
     * 内部联系人默认查询字段
     */
    public final static List<String> INTERIOR_DEFAULT_QUERY_FIELD = new ArrayList<String>(13) {{
        add("姓名");
        add("联系人编号");
//        add("出生日期");
        add("地区");
        add("手机号");
        add("邮箱");
        add("性别");
        add("所属组织");
        add("员工编号");
        add("员工状态");
        add("创建时间");
    }};

    /**
     * 个人联系人基本字段,默认查询顺序
     */
    public static final List<MetaFieldDTO> INDIVIDUAL_QUERY_FIELD = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("联系人编号", "memberNo", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("外部编号", "out_no", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("姓名", "name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("微信昵称", "nickname", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("性别", "gender", "select", "info", Arrays.asList("男", "女")));
        add(new MetaFieldDTO("年龄", "age", "number", "info", new ArrayList()));
        add(new MetaFieldDTO("出生日期", "birthday", "datetime", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "org_name", "level", "info", new ArrayList()));
        add(new MetaFieldDTO("地区", "address", "level", "info", new ArrayList()));
        add(new MetaFieldDTO("微信OpenID", "openid", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("微信UnionID", "union_id", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("微信AppID", "appid", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("支付宝ID", "alipay_user_id", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("创建时间", "createdDT", "datetime", "info", new ArrayList()));
    }};

    /**
     * 机构联系人基本信息
     */
    public final static List<MetaFieldDTO> INSTITUT_QUERY_FIELD = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("联系人编号", "memberNo", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("外部编号", "out_no", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("机构名称", "institut_name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属城市", "address.1", "address", "info", new ArrayList()));
        add(new MetaFieldDTO("机构对接人", "name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属部门", "department", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "org_name", "level", "info", new ArrayList()));
        add(new MetaFieldDTO("所属门店", "store_name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("创建时间", "createdDT", "datetime", "info", new ArrayList()));
    }};

    /**
     * 内部联系人基本信息
     */
    public static final List<MetaFieldDTO> INNER_QUERY_FIELD = new ArrayList<MetaFieldDTO>() {{
        add(new MetaFieldDTO("联系人编号", "memberNo", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("员工编号", "employeeID", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("姓名", "name", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("手机号", "mobile", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("邮箱", "email", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("性别", "gender", "select", "info", Arrays.asList("男", "女")));
        add(new MetaFieldDTO("年龄", "age", "number", "info", new ArrayList()));
        add(new MetaFieldDTO("出生日期", "birthday", "datetime", "info", new ArrayList()));
        add(new MetaFieldDTO("地区", "address", "level", "info", new ArrayList()));
//        add(new MetaFieldDTO("微信OpenID", "openid", "string", "info", new ArrayList()));
//        add(new MetaFieldDTO("支付宝ID", "alipay_user_id", "string", "info", new ArrayList()));
        add(new MetaFieldDTO("所属组织", "org_name", "level", "info", new ArrayList()));
        add(new MetaFieldDTO("员工状态", "employee_status", "select", "info", Arrays.asList(1, 2)));
        add(new MetaFieldDTO("创建时间", "createdDT", "datetime", "info", new ArrayList()));
    }};


    /**
     * 联系人导出表头 v2
     */
    public static final List<String> INDIVIDUAL_EXCEL_EXPORT_HEADERS =
            Arrays.asList("联系人编号", "外部编号", "姓名","微信昵称", "手机号", "邮箱", "性别", "年龄", "出生日期", "所属组织", "省份", "城市", "区县", "街道信息", "微信OpenID", "微信AppID", "支付宝ID", "创建时间");

    public static final List<String> INSTITUTION_EXCEL_EXPORT_HEADERS =
            Arrays.asList("联系人编号", "外部编号", "机构名称", "省份", "城市", "区县", "街道信息", "机构对接人", "所属部门", "手机号", "邮箱", "所属组织", "所属门店", "创建时间");

    public static final List<String> INTERIOR_EXCEL_EXPORT_HEADERS =
            Arrays.asList("联系人编号", "员工编号", "姓名", "手机号", "邮箱", "性别", "年龄", "出生日期", "省份", "城市", "区县", "街道信息", "所属组织", "员工状态", "创建时间");


    /**
     * 30秒 单位:毫秒
     * <p>
     * <p>30 * 1000 = 30000 ms
     */
    public static final int THIRTY_SECOND_UNIT_MILLIS = 30000;

    /**
     * 5min 单位:毫秒
     * <p>
     * <p>5 * 60  * 1000 = 30000 ms
     */
    public static final int FIVE_MIN_UNIT_MILLIS = 5 * 60  * 1000;

    /**
     * 针对分组seq上锁的锁前缀
     */
    public static final String GROUP_LOCK_PREFIX = "member:group:lock:";

    /**
     * 针对分组seq上锁的锁总数量
     */
    public static final Integer GROUP_LOCK_TOTAL_COUNT = 128;

    /**
     * 告警毫秒值，5分钟，保留5秒的时间
     */
    public static final Long GROUP_LOCK_WARNING_MILLISECOND_VALUE = 1000L * (60 * 5 - 5);

}
